package tesis.service;

import java.util.List;
import java.util.Map;
import javax.persistence.EntityManager;

/**
 *
 * @author otto.theo
 */
public interface CrudService {

    EntityManager getEm();

    <T> T create(T t);

    <T> T find(Object id, Class<T> type);

    <T> T update(T t);

    void delete(Object t);

    List findByNamedQuery(String queryName);

    List findByNamedQuery(String queryName, int resultLimit);

    List findByNamedQuery(String namedQueryName, Map<String, Object> parameters);

    List findByNamedQuery(String namedQueryName, Map<String, Object> parameters, int resultLimit);

    List findByNativeQuery(String nativeQuery, Map<String, Object> parameters);

    List<Object> findByNativeQuery(String nativeQuery, Map<String, Object> parameters, int resultLimit);
}
